// pages/first/typedetail/typedetail.js
Page({
  data: {

  },
  onLoad(options) {
    console.log(options)
    this.getTypeGoodsList(options.id)
  },
  getTypeGoodsList(typeId){
    wx.cloud.database().collection('shop_goods')
    .where({
      type:typeId
    })
    .get()
    .then(res=>{
      // console.log(res.data)
      this.setData({
        goodsList:res.data
      })
    })
  },
  //商品详情跳转
  toGoodDetail(event){
    console.log(event)
    let id=event.currentTarget.dataset.id
    wx.navigateTo({
      url: '/pages/goodDetail/goodDetail?id='+id,
    })
  }
})